
#ifndef LAUNCHERMODE // The parameters are modified from below.
#define distCode "./algo/dist/sum.cpp"
#define initStaCode "./algo/initSta/std.cpp"
#define saCode "./algo/sa/std.cpp"
#define engCode "./algo/eng/std.cpp"
#define INC(x) x

#else // For launcher.
#define STRINGIFY(x) #x
#define INC(x) STRINGIFY(x)
#endif

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <tuple>
#include <ctime>
#include <chrono>
#include <cmath>
#include <cassert>
#include <cfloat>
#include <deque>
#include <map>
typedef long long ll;
typedef long double db;

db width, height, timLmt;
size_t cnt;
std::vector<db> ori;
#define push_back emplace_back

#include "./utils/calc.cpp"
#include INC(distCode)
#include "./utils/rnd.cpp"
typedef std::vector<struct Circ> Sta;
#include "./utils/readFile.cpp"
#include "./utils/writeFile.cpp"

#include "./utils/algoCom.cpp"
#include INC(initStaCode)
#include INC(engCode)
#include INC(saCode)

signed main(int argc, char* argv[]) {
    assert(argc == 3), readFile(argv[1]);

    fprintf(stderr, "---    Plating SA Start   ---\n");
    auto stAcc = std::chrono::high_resolution_clock::now();
    auto [res, ansSta] = solve();
    auto edAcc = std::chrono::high_resolution_clock::now();
    fprintf(stderr, "---    Plating SA Done    ---\n");
    db elAcc = std::chrono::duration<db>(edAcc - stAcc).count();

    writeFile(argv[2], res, ansSta);

    fprintf(stderr, "Result: %s\n", res ? "Success" : "Fail");
    fprintf(stderr, "Elapsed time: %Lfs\n", elAcc);
    return 0;
}
